package com.ocom.payhandle.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ocom.common.entity.payconfig.EntityDishesPoint;
import com.ocom.common.enums.DataSourceEnum;
import com.ocom.common.enums.MasterSlaveEnum;
import com.ocom.mysql.aspect.DataSourceAspect;
import com.ocom.payhandle.dao.IDaoDishesPoint;
import com.ocom.payhandle.service.DishesPointService;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class DishesPointServiceImpl extends ServiceImpl<IDaoDishesPoint, EntityDishesPoint> implements DishesPointService {

//    @Autowired
//    private IDaoDishesPoint iDaoDishesPoint;


    @Override
    @DataSourceAspect(type = DataSourceEnum.PART_DB,companyId = "comId",isMaster = MasterSlaveEnum.SLAVE)
    public List<EntityDishesPoint> selectLastDate(Long comId, Integer pointId,String mealDate) {
        QueryWrapper<EntityDishesPoint> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("com_id",comId);
        return  this.list(queryWrapper);
    }



}
